package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;

public class Enseignant implements Serializable {

	private static final long serialVersionUID = -102696127570190087L;

	private int numEnseignant;
	private String nom;
	private String prenom;
	private String adresse;
	private int telephone;
	private Date dateNaissance;
	private String login;
	private String pwd;
	private TypePoste poste;
	private Collection<Role> listeRoles;
	private Collection<Indisponibilite> listeIndisponibilites;
	private Collection<JNTTypeECEnseignant> listeServices;
	private Collection<Creneau> listeCreneaux;

	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Enseignant() {}
	
	public Enseignant(int numEnseignant, String nom, String prenom,
			String adresse, int telephone, Date dateNaissance, String login,
			String pwd, TypePoste poste) {
		super();
		this.numEnseignant = numEnseignant;
		this.nom = nom;
		this.prenom = prenom;
		this.adresse = adresse;
		this.telephone = telephone;
		this.dateNaissance = dateNaissance;
		this.login = login;
		this.pwd = pwd;
		this.poste = poste;
		this.listeCreneaux = null;
		this.listeIndisponibilites = null;
		this.listeRoles = null;
		this.listeServices = null;
	}



	public Collection<Creneau> getListeCreneau() {
		return listeCreneaux;
	}

	public void setListeCreneau(Collection<Creneau> listeCreneau) {
		this.listeCreneaux = listeCreneau;
	}
	
	public Collection<JNTTypeECEnseignant> getListeServices() {
		return listeServices;
	}

	public void setListeServices(Collection<JNTTypeECEnseignant> listeServices) {
		this.listeServices = listeServices;
	}
	
	public Collection<Indisponibilite> getIndisponibilites() {
		return listeIndisponibilites;
	}

	public void setIndisponibilites(Collection<Indisponibilite> indisponibilites) {
		this.listeIndisponibilites = indisponibilites;
	}
	
	public int getNumEnseignant() {
		return numEnseignant;
	}

	public void setNumEnseignant(int numEnseignant) {
		this.numEnseignant = numEnseignant;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getPrenom() {
		return prenom;
	}

	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	public String getAdresse() {
		return adresse;
	}

	public void setAdresse(String adresse) {
		this.adresse = adresse;
	}

	public int getTelephone() {
		return telephone;
	}

	public void setTelephone(int telephone) {
		this.telephone = telephone;
	}

	public Date getDateNaissance() {
		return dateNaissance;
	}

	public void setDateNaissance(Date dateNaissance) {
		this.dateNaissance = dateNaissance;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public TypePoste getPoste() {
		return poste;
	}

	public void setPoste(TypePoste poste) {
		this.poste = poste;
	}
	
	public Collection<Role> getRoles() {
		return listeRoles;
	}

	public void setRoles(Collection<Role> roles) {
		this.listeRoles = roles;
	}

	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	}
}
